package com.luoqian.demo02;


// 抽奖环节
public class LuckyDraw {
    public static void main(String[] args) {
        //抽奖机
        AwardGetter<String> stringAwardGetter = new AwardGetter<>();
        String[] items = {"iphone 13 pro","macbook pro 2021","airpods 3","apple watch"};
        for (int i = 0; i < items.length; i++) {
            stringAwardGetter.addItems(items[i]);
        }
        String award = stringAwardGetter.getAward();
        System.out.println("congratulation！u get："+ award);


        System.out.println("---------");
        //抽奖机
        AwardGetter<Integer> integerAwardGetter = new AwardGetter<>();
        int[] items2 = {10000,5000,2000,1000,500};
        for (int i = 0; i < items2.length; i++) {
            integerAwardGetter.addItems(items2[i]);
        }
        Integer award2 = integerAwardGetter.getAward();
        System.out.println("congratulation！u get cash："+ award2);
    }


}
